package org.example.infrastructure.order.gatewayimpl.database.dataobject;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.example.infrastructure.common.base.BaseDO;

/**
 * 订单商品表
 */
@EqualsAndHashCode(callSuper = true)
@TableName(value = "order_item")
@Data
public class OrderItemDO extends BaseDO<Long> {
    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 订单id
     */
    @TableField(value = "order_id")
    private Long orderId;

    /**
     * 订单号
     */
    @TableField(value = "order_no")
    private String orderNo;

    /**
     * 商品id
     */
    @TableField(value = "item_id")
    private Long itemId;

    /**
     * 商品名称
     */
    @TableField(value = "item_name")
    private String itemName;

    /**
     * 商品单价(单位：分)
     */
    @TableField(value = "item_price")
    private Long itemPrice;

    /**
     * 数量
     */
    @TableField(value = "quantity")
    private Integer quantity;

    @Override
    public Long getPrimaryId() {
        return id;
    }

    @Override
    public void setPrimaryId(Long id) {
        this.id = id;
    }
}